﻿IF EXISTS (SELECT * from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id where p.name='entity_insert' and s.name='Crm')
DROP PROCEDURE [Crm].entity_insert
GO
CREATE PROCEDURE [Crm].entity_insert 
@PK uniqueidentifier, 
@Manager nvarchar(100), 
@Name nvarchar(100), 
@Company nvarchar(100), 
@Title nvarchar(20), 
@Phone varchar(15), 
@Mobile varchar(15), 
@Source nvarchar(50), 
@Url nvarchar(50), 
@Mail nvarchar(30), 
@Fax varchar(15), 
@Status nvarchar(20), 
@Skype nvarchar(30), 
@Twitter nvarchar(50), 
@Sector nvarchar(50), 
@NoMail bit, 
@Adress nvarchar(200), 
@ZipCode varchar(10), 
@City nvarchar(50), 
@Country nvarchar(50), 
@Description nvarchar(500)
AS
BEGIN
INSERT INTO [Crm].[Entity]
([id_Entity], [manager], [name], [company], [title], [phone], [mobile], [source], [url], [mail], [fax], [status], [skype], [twitter], [sector], [no_mail], [adress], [zip_code], [city], [country], [description])
VALUES (@PK,@Manager,@Name,@Company,@Title,@Phone,@Mobile,@Source,@Url,@Mail,@Fax,@Status,@Skype,@Twitter,@Sector,@NoMail,@Adress,@ZipCode,@City,@Country,@Description)
END